<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="${pageContext.request.contextPath}/statics/bootstrap-3.3.5-dist/css/bootstrap.min.css" title="" rel="stylesheet" />
<link title="" href="${pageContext.request.contextPath}/statics/css/style.css" rel="stylesheet" type="text/css"  />
<link title="blue" href="${pageContext.request.contextPath}/statics/css/dermadefault.css" rel="stylesheet" type="text/css"/>
<link title="green" href="${pageContext.request.contextPath}/statics/css/dermagreen.css" rel="stylesheet" type="text/css" disabled="disabled"/>
<link title="orange" href="${pageContext.request.contextPath}/statics/css/dermaorange.css" rel="stylesheet" type="text/css" disabled="disabled"/>
<link href="${pageContext.request.contextPath}/statics/css/templatecss.css" rel="stylesheet" title="" type="text/css" />
<script src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
<script src="${pageContext.request.contextPath}/statics/script/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/statics/script/jquery.cookie.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/statics/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath }/statics/ckeditor/ckeditor.js"></script>
<style type="text/css">
	
	a{text-decoration:none;} 
	.max:hover{
		width: 20%;
		height: 20%;
	}
</style>
<script type="text/javascript">
    window.onload = function()
    {
        CKEDITOR.replace( 'description');
    };
</script>
</head>
<body>

			<div style="border-bottom: 1px solid #D0D0D0;" >
				<div style="width: 30%;position:relative; left: 40px;">
				
					<a href="" style="text-decoration:none;">
					
					
						<img src="${com.headimg}" class="constellation" style="border-radius: 50%;" width="50px;" height="50px;" alt="" />
					
					
					</a>
					&nbsp;
					<span style="vertical-align:text-top;"><a class="a" style="text-decoration:none;" href="">
					
					
						${com.username}
					
						
					</a>
					<c:if test="${com.userrole==1}">
						<span style="background-color: #FF9707;border-radius: 35%;color: #FFFFFF;">&nbsp;&nbsp;楼管&nbsp;&nbsp;</span>
					</c:if>
						<span style="font-size: 4px;color: #319DE5;">
							
						</span>
					</span>
					<br />
						<span style="font-size: 4px;position: relative;top: -20px;left: 63px;">${com.jointime}</span>
				</div>
				<div style=" width: 90%; position:relative; left: 100px;">
					<div>${com.context }</div>
					<br />
					<div>
						<c:if test="${not empty com.contextimg}"><img class="max" width="15%" height="15%" src="${com.contextimg}" alt="" /></c:if>
						<c:if test="${empty com.contextimg}"></c:if>
					</div>
					<p align="right">
						<input type="hidden" class="dianzan" name="postid" value="" />
					</p>
				</div>
			</div>
		
 <div class="col-md-4">
                     <div class="panel panel-default">
                      <div class="panel-heading">
                      所有评论
                       <a href="#" class="pull-right"><span class="glyphicon glyphicon-refresh"></span></a>
                      </div>     
                      <div class="panel-body" style="overflow: scroll;height: 600px;">
                         <c:if test="${empty list}">
                         	<p align="center">暂无评论，快去评论吧！</p>
                         </c:if>
                         <c:if test="${not empty list}">
                          <c:forEach items="${list}" var="list">
                          	<div><span style="color: gray;">@${list.username}</span>
                          	<c:if test="${list.userrole==1}">
						<span style="background-color: #FF9707;border-radius: 35%;color: #FFFFFF;">&nbsp;&nbsp;楼管&nbsp;&nbsp;</span>
					</c:if>
                          	<c:if test="${list.comment_userid==userlogin.userid}">
                          	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          	<a href="${pageContext.request.contextPath}/comment/deleteComment?commentid=${list.commentid}&complaintsid=${com.complainid}" onclick="return confirm('确认要删除这条评论吗？')" style="text-decoration: none;"><img src="${pageContext.request.contextPath}/statics/images/delete.jpg" alt="" width="16px;" height="16px" />&nbsp;删除</a></c:if>  <br />${list.commentcontext}</div><br />
                          	<span style="color: gray;">${list.jointime}</span>
                          	<hr />
                          </c:forEach>
                          </c:if>
                      </div>
                    </div>
                 </div>
                 <div style="width:880px;height: 100px;float: right;">
                 <p><h3>发表评论：</h3></p>
                <form enctype="multipart/form-data" action="${pageContext.request.contextPath}/comment/saveComment" method="post">
                <input type="hidden" name="comment_userid" value="${userlogin.userid}" />
                <input type="hidden" name="comment_complainid" value="${com.complainid}" />
		<textarea name="commentcontext" id="description" style="width: 200px; height:100px; "/></textarea>
		<!-- <input type="text" name="content" /> -->
		<br />
		<input type="submit" class="btn btn-default" value="发表" />
		<a target="_top" href="${pageContext.request.contextPath}/users/redirct"><input type="button" class="btn btn-default" value="返回" /></a>
	</form>
	</div>
</body>
</html>